package ru.tennisworld.match.exceptions;

import lombok.Getter;
import lombok.Setter;
import org.springframework.http.HttpStatus;
import ru.tennisworld.match.data.enums.ErrorResponseCode;

@Getter
@Setter
public class MatchServiceException extends RuntimeException {

    private ErrorResponseCode code = ErrorResponseCode.GENERIC_ERROR;

    private int httpStatus = 500;

    public MatchServiceException() {
    }

    public MatchServiceException(String message) {
        super(message);
    }

    public MatchServiceException(String message, Throwable cause) {
        super(message, cause);
    }

    public MatchServiceException(Throwable cause) {
        super(cause);
    }

    public MatchServiceException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    public MatchServiceException(String message, HttpStatus httpStatus) {
        super(message);
        this.httpStatus = httpStatus.value();
    }

    public MatchServiceException(ErrorResponseCode code, int httpStatus) {
        this.code = code;
        this.httpStatus = httpStatus;
    }

    public MatchServiceException(String message, ErrorResponseCode code, int httpStatus) {
        super(message);
        this.code = code;
        this.httpStatus = httpStatus;
    }
}
